import axios, { AxiosPromise, AxiosResponse } from "axios";
import querystring from "query-string";
import * as dotenv from "dotenv";

export function myPost(url: string, form: Record<string, string|number>): AxiosPromise {
    return axios.post(
        url,
        querystring.stringify(form),
        {
            headers: {
                "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
            }
        }
    )
}

dotenv.config();

const BASE_URL = "http://" + process.env["VUE_APP_BACKEND_ADDR"] + ":" + process.env["VUE_APP_BACKEND_PORT"];
export { BASE_URL , AxiosResponse as Response}
